package com.xiaoma.pattern.proxy.jdk;

import com.xiaoma.pattern.proxy.jdk.strategy.Strategy;

import java.lang.reflect.Method;

public class Context {

  private Strategy strategy;

  public Context(Strategy strategy){
    this.strategy = strategy;
  }


  public void setStrategy(Strategy strategy) {
    this.strategy = strategy;
  }

  public Object executeStrategy(Object proxy, Method method, Object[] args,Object target){
    return strategy.invoke(proxy, method, args,target);
  }
}
